//
//  KKAdditionalAdviceDialog.m
//  DoMi
//
//  Created by 康凯 on 2016/12/26.
//  Copyright © 2016年 kk. All rights reserved.
//

#import "KKAdditionalAdviceDialog.h"
#import "KKAdviceChatVC.h"

@implementation KKAdditionalAdviceDialog

-(void)awakeFromNib{
    [super awakeFromNib];
    self.frame = [UIScreen mainScreen].bounds;
    self.containerBottom.constant=-240;
    [self layoutIfNeeded];
    self.backgroundColor=[UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
}
#pragma mark 弹框--展示
-(void)show{
    [appWindow addSubview:self];
    [UIView animateWithDuration:dialog_animation_time animations:^{
        self.containerBottom.constant=8;
        [self layoutIfNeeded];
    }];
}
#pragma marm 弹框--消失
-(void)dismiss{
    [UIView animateWithDuration:dialog_animation_time animations:^{
        [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
        self.containerBottom.constant=-240;
        [self layoutIfNeeded];
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}
#pragma mark 按钮--跳追加提问
-(IBAction)pushAdvice:(id)sender{
    [self dismiss];
    KKAdviceChatVC *chat=[[KKAdviceChatVC alloc] init];
    chat.flag=0;
    chat.consultId=@"";
    chat.expertId=self.expertId;
    chat.expertName=self.nickname;
    chat.expertCompany=self.company;
    [self.commentVC.navigationController pushViewController:chat animated:YES];
    
}
#pragma mark 按钮--取消
- (IBAction)cancle:(id)sender {
    [self dismiss];
    [self.commentVC.navigationController popViewControllerAnimated:YES];
}

@end
